<%@page import="com.gopay.remote.solution.vo.PayChannelDtlInfo"%>
<%@page import="com.gopay.common.constants.trans.PayChannel"%>
<%@page import="com.gopay.cashier.domain.bean.PayChannelDtlBean"%>
<%@page import="com.gopay.common.constants.trans.PayChannelType"%>
<%@page import="com.gopay.cashier.domain.bean.PayChannelWayBean"%>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="../common/init_context.jsp"%>
<%@ page import="java.util.List"%>
<%
    int moreBanks = 15;
    PayChannelWayBean pw=(PayChannelWayBean)request.getAttribute("payWayBean");
    PayChannelDtlBean pcb = pw.getPayChannelDtl(PayChannelType.CREDIT_EXPRESS_PAY.value);
    List<PayChannelDtlInfo> ccfBanks =  pcb.getBankCodes().get(PayChannel._06.value);
    int ccfBankCount = ccfBanks==null?0:ccfBanks.size();
%>
<c:set var="ccfBankCount" value="<%=ccfBankCount %>"/>

<script type="text/javascript" src="${ROOT}/static/js/gopay/expressPayChannel.js"></script>
<script type="text/javascript">
    var ccfBankCount = '<%=ccfBankCount %>';
</script>


<form name="ccfbankPayForm" id="ccfbankPayForm" action="${ROOT}/pay/ccfp/index.shtml" method="post">
    <div class="tabscon" id="creditExpressPayTab">
        <c:if test='${ccfBankCount gt 0 }'>
            <table class="table-tml-3" id="corpBankList">
                <tbody>
                <%
                    //输出企业银行的图标
                    for(int i=0; i<ccfBankCount && i<moreBanks; i++){
                        PayChannelDtlInfo info = ccfBanks.get(i);
                        String bc = info.getOutStlmId();
                        if(i!=0&&i%3==0)out.print("</tr>");
                        if(i%3==0)out.print("<tr>");
                        if(i==0){
                            out.print("<th rowspan=\"5\">选择支付银行：</th>");
                        }
                        out.print("<td>\n");
                        out.print("<input type='radio' id='c_c_f_"+i+"' name='payBankCode' value='"+bc+"'>\n");
                        out.print("<img width='190' height='36' border='0' src='"+request.getContextPath()+"/BankIcon/"+bc+".jpeg' onclick=\"ccfastSel('c_c_f_"+i+"',this);\" alt='"+bc+"' style='cursor:pointer'/>\n");
                        out.print("</td>\n");
                    }
                    out.print("</tr>");
                    if(ccfBankCount > moreBanks){
                %>
                <tr>
                    <td colspan="4" align="right"><a  href="javascript:void(0);" class="more"  onclick="showAllFastBanks('06');">更多银行</a></td>
                </tr>
                <%} %>
                <tr>
                    <td colspan="4" align="center">
                        <button type="button" class="btn-1" onclick="ccfastPaySubmit('06','ccfbankPayForm');">下一步</button>
                    </td>
                </tr>
                </tbody>
            </table>
        </c:if>
    </div>
    <input type="hidden" name="orderId" id="orderId" value="<%=request.getParameter("orderId")%>"/>
    <input type="hidden" name="formhash" id="formhash" value="${formhash }"/>
    <input type="hidden" name="pageFrom" value="order"/>
</form>

<div id="allCrExpressBanksDialog" style="display:none">
    <form name="allCcfPayForm" id="allCcfPayForm" action="${ROOT}/pay/ccfp/index.shtml" method="post">
        <table class="table-tml-3" style="width:750px">
            <tbody>
            <%
                if(ccfBankCount > moreBanks){
                    for(int i=0; pw!=null && i<ccfBanks.size(); i++){
                        PayChannelDtlInfo info = ccfBanks.get(i);
                        String bc = info.getOutStlmId();
                        if(i!=0&&i%3==0)out.print("</tr>");
                        if(i%3==0)out.print("<tr>");
                        out.print("<td>\n");
                        out.print("<input type='radio' id='a_c_c_f_"+i+"' name='payBankCode' value='"+bc+"'>\n");
                        out.print("<img width='190' height='36' border='0' src='"+request.getContextPath()+"/BankIcon/"+bc+".jpeg' onclick=\"ccfastSel('a_c_c_f_"+i+"',this);\" alt='"+bc+"' style='cursor:pointer'/>\n");
                        out.print("</td>\n");
                    }
                    out.print("</tr>");
                }
            %>
            </tbody>
        </table>
        <table class="table-tml-3" style="width:750px">
            <tbody>
            <tr>
                <td align="center">
                    <button class="btn-1" type="button" onclick="ccfastPaySubmit('06','allCcfPayForm');">下一步</button>
                </td>
            </tr>
            </tbody>
        </table>
        <input type="hidden" name="orderId" id="orderId" value="<%=request.getParameter("orderId")%>"/>
        <input type="hidden" name="formhash" id="formhash" value="${formhash }"/>
        <input type="hidden" name="pageFrom" value="order"/>
        <input type="hidden" name="payChannel" value="06"/>
    </form>
</div>